let proxyObj = {}

proxyObj['/'] = {
    // websocket
    ws: false,
    // 目标地址
    target: 'http://localhost:10010',
    // 发送请求头host会被设置target
    changeOrigin: true,
    // 不重写请求地址
    pathReWrite: {
        '^/': '/'
    }
};

module.exports = {
    devServer: {
        host: 'localhost',
        port: '8080',
        proxy: proxyObj
    },
    chainWebpack: config => {
        config.module
            .rule('scss')
            .test(/\.scss$/)
            .oneOf('vue')
            .use('px2rem')
            .loader('px2rem-loader')
            .before('postcss-loader')
            .options({
                remUnit: 75 // 设计稿的宽度的1/10
            }).end()
    }
}